package com.atguigu.h_peek;

import java.util.function.Consumer;
import java.util.stream.Stream;

public class Demo {
    public static void main(String[] args) {
        //进工厂
        Stream<String> stream = Stream.of("100", "200", "300");

        //进peek车间
        Stream<String> peek = stream.peek(new Consumer<String>() {
            @Override
            public void accept(String s) {
                System.out.println(s + "Hello");
            }
        });


        //出工厂
        peek.forEach(System.out::println);
    }
}
